package com.company.CollectionDemo;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

import com.company.Thread.UserInfo;

public class ArrayListDemo {
    public static void main(String[] args) {

        List<UserInfo> list = new ArrayList<>(10);
        for (int i = 0; i < 10; i++) {
            UserInfo userInfo = new UserInfo();
            if (i > 5) {
                userInfo.setAge(i);
            }
            list.add(userInfo);
        }

        Stream<Integer> stream = list.stream().map(UserInfo::getAge);

        // 不会初始化数组大小
        int[] a = {11, 2, 3, 4};
        System.out.println(a[1]);
        System.out.println(list.size());
    }
}
